package com.haoshuang.zhouzhoubang.ui.page.home.settings.skill.record


import android.graphics.Color
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager
import com.haoshuang.zhouzhoubang.databinding.ItemJnBinding
import com.haoshuang.zhouzhoubang.model.bean.Jn2Bean
import com.mufeng.libs.base.BaseBindingHolder
import com.mufeng.libs.base.BaseBindingQuickAdapter


/**
 * 订单模块中的订单列表适配器
 * */
class JnAdapter(data: MutableList<Jn2Bean>) :
    BaseBindingQuickAdapter<Jn2Bean, ItemJnBinding>(data) {

    override fun onBindViewHolder(holder: BaseBindingHolder, position: Int, item: Jn2Bean?) {
        val binding = ItemJnBinding.bind(holder.itemView)
        binding.apply {
            var adapter = ServiceLabelAdapter2(item?.cate_name?: mutableListOf())
            var lay = LinearLayoutManager(context)
            lay.orientation = LinearLayoutManager.HORIZONTAL
            rvList.layoutManager = lay
            rvList.adapter = adapter
            tvTime.text = "创建时间：${item?.add_time}"
            when (item?.status) {
                0 -> {
                    tvState.text = "审核中"
                    tvState.setTextColor(Color.parseColor("#FFCC00"))
                }

                1 -> {
                    tvState.text = "已通过"
                    tvState.setTextColor(Color.parseColor("#FF0000"))
                }

                2 -> {
                    tvState.text = "未通过"
                    tvState.setTextColor(Color.parseColor("#28CD41"))
                }
            }

        }
    }

}